import http from "@utils/request";

import { MenuResponse, MenuItemForm, MenuResponseOther } from "@interface/menu";

//新增
export const menuAdd = (data: MenuItemForm): Promise<MenuResponseOther> => {
    return http.post<MenuResponseOther>('/system_menu/', data);
}

//详情
export const menuInfo = (id: string): Promise<MenuResponse> => {
    return http.get<MenuResponse>(`/system_menu/${id}`)
}



//修改
export const menuUpdata = (data: MenuItemForm): Promise<MenuResponse> => {
    return http.put<MenuResponse>('/system_menu/', data);
}

//删除
export const detleUpdata = (id: string): Promise<MenuResponse> => {
    return http.delete<MenuResponse>(`/system_menu/${id}`);
}